package com.flyqiu.flow.boot.events;

import com.alibaba.fastjson2.JSONObject;

import com.flyqiu.flow.event.ActInstEvent;
import com.flyqiu.flow.event.ActInstEventContext;
import org.springframework.stereotype.Component;


@Component
public class TestFlowActivityEvent implements ActInstEvent {

    @Override
    public void createBefore(ActInstEventContext inst) {
        System.out.printf("process:活动:createBefore：%s %s %n", inst.getElementInstance().getDefKey(), inst.getElementInstance().getDefName());
    }

    @Override
    public void createAfter(ActInstEventContext inst) {
        System.out.printf("process:活动:createAfter：%s %s %n", inst.getElementInstance().getDefKey(), inst.getElementInstance().getDefName());
    }

    @Override
    public void completeBefore(ActInstEventContext inst) {
        System.out.printf("process:活动:completeBefore：%s %s %n", inst.getElementInstance().getDefKey(), inst.getElementInstance().getDefName());
    }

    @Override
    public void completeAfter(ActInstEventContext inst) {
        System.out.printf("process:活动:completeAfter：%s %s %n", inst.getElementInstance().getDefKey(), inst.getElementInstance().getDefName());
    }

    @Override
    public void deleteBefore(ActInstEventContext inst, JSONObject params, String reason) {
        System.out.printf("process:活动:deleteBefore：%s %s %n", inst.getElementInstance().getDefKey(), inst.getElementInstance().getDefName());
    }

    @Override
    public void deleteAfter(ActInstEventContext inst, JSONObject params, String reason) {
        System.out.printf("process:活动:deleteAfter：%s %s %n", inst.getElementInstance().getDefKey(), inst.getElementInstance().getDefName());
    }
}
